<script type="text/javascript"> 
$(document).ready(function(){
 
	$("h2").append('<em></em>')
 
	$(".thumbs a").click(function(){
	
		var largePath = $(this).attr("href");
		var largeAlt = $(this).attr("title");
		
		$("#largeImg").attr({ src: largePath, alt: largeAlt });
		
		$("h2 em").html(" (" + largeAlt + ")"); return false;
	});
	
});
</script> 

<style type="text/css"> 
#largeImg {
    margin: 0px;
	border: solid 1px #000;
	width: 280px;
	height: 360px;
	padding: 5px;
}
.thumbs img {
    margin:0px 0px 5px 0px;
	border: solid 1px #000;
	width: 90px;
	height: 106px;
	padding: 4px;
}
.thumbs img:hover {
	border-color: #fff;
}
</style>


<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loading_image : 'facebox/loading.gif',
close_image   : 'facebox/closelabel.gif'
}) 
})
</script>

<script type="text/javascript">
$(window).load(function(){
	//for each description div...
	$('div.description').each(function(){
		//...set the opacity to 0...
		$(this).css('opacity', 0);
		//..set width same as the image...
		$(this).css('width', $(this).siblings('img').width());
		//...get the parent (the wrapper) and set it's width same as the image width... '
		$(this).parent().css('width', $(this).siblings('img').width());
		//...set the display to block
		$(this).css('display', 'block');
	});
	
	$('div.the_image').hover(function(){
		//when mouse hover over the wrapper div
		//get it's children elements with class descriptio
		//and show it using fadeTo
		$(this).children('.description').stop().fadeTo(100, 0.7);
	},function(){
		//when mouse out of the wrapper div
		//use fadeTo to hide the div
		$(this).children('.description').stop().fadeTo(100, 0);
	});
	
});
  
</script>

<style>
div.the_image{
    float:left;
    position:relative; /* important(so we can absolutely position the description div */ 
    padding:6px;
}
div.description{
    margin-left: 6px;
    width:165px;
    position:absolute; /* absolute position (so we can position it where we want)*/
    bottom:5px; /* position will be on bottom */
    left:0px;
    display:none; /* hide it */
    /* styling bellow */
    background-color:black;
    color:white;
}
div.description_content{
    padding:0px 5px 15px 5px;
}
a.order_link{
    margin-top: 10px;
    padding:2px;
    color:white;
    text-decoration:none;
    border:1px solid #ccc;
}
a.order_link:hover{
    padding:2px;
    color:black;
    background-color:white;
    text-decoration:none;
    border:1px solid #ccc;
}
p#product_name {
    margin-bottom:2px;
}

a#side_link{
    text-decoration:none;
}
#img_prod_fast{
    padding:5px;
    float:left;
}
#detail_prod_fast{
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    border:1px solid #ccc;
    padding:5px;
    height:210px;
}
.name_produk_fast{
    padding:0px 0px 4px 0px;
    line-height: 1.2em;
    color:#000000;
    font-size: 12px;
    font-weight: bold;
}
.desc_produk_fast{
    color:#000000;
    line-height: 1.2em;
    font-size: 11px;
    padding:0px 0px 7px 0px;
    
}
</style>

<!-- left konten  -->
<div class="span-18">
    <div class="left_konten">
    <div class="breadcumbs"><?php echo $cumb;?></div>

            <div class="span-18">
            <!-- list product content -->
            <div class="detail_product">
                    <div class="span-8 last">
                            <div class="slider-wrap">
                                    <div id="main-photo-slider" class="">
                                            <div class="panelContainer">
                                                <p><img id="largeImg" src="<?php echo base_url().'public/product/'.$row->produk_img_url;?>" alt="Image 2"></p>
                                                
                                            </div>
                                    </div>                      
                            </div>
                    </div>
                            <div class="span-3 last">
								<div class="thumbs">
                                                    <?php foreach ($arr_image as $row_image):?>
                                                    <a href="<?php echo base_url().'public/product/'.$row_image['produk_img_url'];?>" title="Image 3"><img src="<?php echo base_url().'public/product/'.$row_image['produk_img_url_small'];?>"></a>
                                                    <?php endforeach;?>
                                                                       
                                                </div>
                            </div>
							
							
							
							<div class="span-6 last">
								<div class="prod_desc">
										<h3><?php echo $row->nama_produk;?></h3>
										<span>Vote on FB (like button)</span><br><br>

										<span><?php echo $row->deskripsi;?></span><br>

										<?php if ($row->persen_diskon != 0):?>
										<label style="color:#000000;">PRICE</label><br>
										<span class="red" style="text-decoration: line-through;"><?php echo formatHarga($row->harga,'lengkap')?></span> Disc : <?php echo $row->persen_diskon;?> %
										<h3><?php echo formatHarga(getPriceDiskon($row->harga,$row->persen_diskon),'lengkap')?></h3>
										<?php else:?>
										<label style="color:#000000;">PRICE</label>
										<h3><?php echo formatHarga($row->harga,'lengkap')?></h3>

										<?php endif;?>
										
									 
										<div class="check">

										<form method="post" action="<?php echo site_url()?>order/add_cart" method="post">
												<label style="color:#000000;">QTY : </label>
												<?php echo form_error('jml', '<div class="error">', '</div>'); ?>
												 <?php echo form_error('size_produk_id', '<div class="error">', '</div>'); ?>
												<input class="input" type="text" name="jml" size="2" value="1">
	  
												<label style="color:#000000;">SIZE : </label>
												<?php echo sizeDropdown(FALSE,$row->produk_id);?>
												<?php if (!$this->session->flashdata('message_type')):?>
												<?php else: ?>
														<?php echo '<br />'.$this->session->flashdata('message_type');?>
												<?php endif; ?>
												   
												 <input type="hidden" name="id_kat" value="<?php echo $row->prod_kat_id;?>"/>
												 <input type="hidden" name="id_brand" value="<?php echo $row->prod_brand_id;?>"/>
												 <input type="hidden" name="id_prod" value="<?php echo $row->produk_id;?>"/>
												 <input type="hidden" name="slug" value="<?php echo makeslug($row->nama_produk);?>"/>
												
												<input type="submit" class="cart_button" name="submit" value="ADD TO CART"/>
												 <?php if ($this->session->flashdata('message_type4')):?>
												 <?php echo '<br>'.$this->session->flashdata('message_type4').'<br />';?>
												 <?php endif;?>
												
												
										</form>
											OR
										<form method="post" action="<?php echo site_url()?>order/add_wishlist" method="post">
											 <input type="hidden" name="id_kat" value="<?php echo $row->prod_kat_id;?>"/>
											 <input type="hidden" name="id_brand" value="<?php echo $row->prod_brand_id;?>"/>
											 <input type="hidden" name="id_prod" value="<?php echo $row->produk_id;?>"/>
											 <input type="hidden" name="slug" value="<?php echo makeslug($row->nama_produk);?>"/>
											
											<input type="submit" class="cart_button" name="submit" value="ADD WISHLIST"/>
											 <?php if ($this->session->flashdata('message_type2')):?>
											 <?php echo '<br>'.$this->session->flashdata('message_type2');?>
											 <?php endif;?>
											 <?php if ($this->session->flashdata('message_type3')):?>
											 <?php echo '<br>'.$this->session->flashdata('message_type3');?>
											 <?php endif;?>
										</form>

									   
										<br>
									 
										</div>
								</div>
                            </div>
							

            </div>
            </div>
    </div>
<div class="span-18 last">
    <div class="fav">
            <div class="fav_title"></div>
				<?php if ($arr_produk_fav):
				$i = 1;
				foreach($arr_produk_fav as $row_produk_fav):?>
				<div class="the_image">
				<a href="#" title="Lihat Detail Produk <?php echo $row_produk_fav['nama_produk']?>"></a>
				<div class="productImg">
								
					<a href="#" title="Lihat Detail <?php echo $row_produk_fav['nama_produk']?>"></a>
					<div class="thumb">
						<a href="#" title="Lihat <?php echo $row_produk_fav['nama_produk']?>"></a>
						<div><a href="<?php echo base_url().'produk/view/'.$row_produk_fav['prod_brand_id'].'/'.$row_produk_fav['prod_kat_id'].'/'.$row_produk_fav['produk_id'].'/'.alias($row_produk_fav['nama_produk'])?>" title="Lihat Detail <?php echo $row_produk_fav['nama_produk']?>">
							</a><a href="<?php echo base_url().'produk/view/'.$row_produk_fav['prod_brand_id'].'/'.$row_produk_fav['prod_kat_id'].'/'.$row_produk_fav['produk_id'].'/'.alias($row_produk_fav['nama_produk'])?>" title="Lihat Produk <?php echo $row_produk_fav['nama_produk']?>"><img src="<?php echo base_url()?>public/product/<?php echo $row_produk_fav['produk_img_thumb']?>" class="productthumb"></a>
						</div>
					</div>
						   
				</div>
							<div class='description'>
								<div class='description_content'>
									<?php if($row_produk_fav['persen_diskon'] != 0):?>
													<div class="productTitle">
															<h5><a href="<?php echo base_url().'produk/view/'.$row_produk_fav['prod_brand_id'].'/'.$row_produk_fav['prod_kat_id'].'/'.$row_produk_fav['produk_id'].'/'.alias($row_produk_fav['nama_produk'])?>" title="Lihat Detail Produk <?php echo $row_produk_fav['nama_produk']?>"><?php echo $row_produk_fav['nama_produk']?></a></h5>
															<h5><span style="text-decoration: line-through;color:#ff0000;"><?php echo formatHarga($row_produk_fav['harga'],'lengkap')?></span> <span style="color:#ff9900;">Disc : <?php echo $row_produk_fav['persen_diskon']?> % </span></h5>
													</div>
													<div class="productPrice">	
															<h5 class="mainprice"><span>Rp</span> <?php echo formatHarga($row_produk_fav['harga_baru'],'lengkap')?>&nbsp;&nbsp;</h5>
													</div>



													<a class="order_link" rel="facebox" title="Beli Produk <?php echo $row_produk_fav['nama_produk']?>" href="#buy<?php echo $i;?>">QUICK SHOP</a>
									<?php else:?>
													<div class="productTitle">
															<h5><a href="<?php echo base_url().'produk/view/'.$row_produk_fav['prod_kat_id'].'/'.$row_produk_fav['produk_id'].'/'.alias($row_produk_fav['nama_produk'])?>" title="Lihat Detail Produk <?php echo $row_produk_fav['nama_produk']?>"><?php echo $row_produk_fav['nama_produk']?></a></h5>
															<h5>&nbsp;</h5>
													</div>

													<div class="productPrice">	
															<h5 class="mainprice"><span>Rp</span> <?php echo formatHarga($row_produk_fav['harga'],'lengkap')?>&nbsp;&nbsp;</h5>
													</div>

													<a class="order_link" rel="facebox" title="Beli Produk <?php echo $row_produk_fav['nama_produk']?>" href="#buy<?php echo $i;?>">QUICK SHOP</a>
									<?php endif;?>
								 </div>
							</div>
				
							</div>
			
			
			
			<!-- use Jquery dan Facebox plugin -->
				<div id="buy<?php echo $i;?>" style="display:none;">		
					<div id="img_prod_fast">
						<img class="image_event" alt="<?php echo $row_produk_fav['nama_produk']?>" src="<?php echo base_url()?>public/product/<?php echo $row_produk_fav['produk_img_thumb']?>" />
					</div>
					<div id="detail_prod_fast">
						<div class="name_produk_fast"><?php echo $row_produk_fav['nama_produk']?></div>
						<div class="desc_produk_fast"><?php echo $row_produk_fav['deskripsi']?></div>
											<div class="price_fast">
												<?php if($row_produk_fav['persen_diskon'] != 0):?>
														<label style="color:#000000;"><strong>PRICE : </strong></label><br>
														<div class="productPrice_fast">	
															<h5 class="discprice_fast"><span style="text-decoration: line-through;color:#ff0000;"><?php echo formatHarga($row_produk_fav['harga'],'lengkap')?></span> <span style="color:#ff9900;">Disc : <?php echo $row_produk_fav['persen_diskon']?> % </span></h5>
														</div>
														<div class="productPrice_fast">	
																<h5 class="mainprice_fast"><span>Rp</span> <?php echo formatHarga($row_produk_fav['harga_baru'],'lengkap')?>&nbsp;&nbsp;</h5>
														</div>
												<?php else:?>
														<label style="color:#000000;"><strong>PRICE : </strong></label><br>
														 <div class="productPrice_fast">	
																<h5 class="mainprice_fast"><span>Rp</span> <?php echo formatHarga($row_produk_fav['harga'],'lengkap')?>&nbsp;&nbsp;</h5>
														</div>
												<?php endif;?>
											</div>
						<form method="post" action="<?php echo site_url()?>order/add_cart_fast/<?php echo $row_produk_fav['prod_kat_id'];?>/<?php echo $row_produk_fav['produk_id'];?>" method="post">
						<p>
						<label style="color:#000000;"><strong>SIZE : </strong></label>
						 <?php echo sizeDropdown(FALSE,$row_produk_fav['produk_id']);?>


						<label style="color:#000000;"><strong>QTY : </strong></label>
						<input class="input" type="text" name="jml" size="5" value="1"/>
											
											 <input type="hidden" name="id_kat" value="<?php echo $row_produk_fav['prod_kat_id'];?>"/>
											<input type="hidden" name="id_brand" value="<?php echo $row_produk_fav['prod_brand_id'];?>"/>
											<input type="hidden" name="id_prod" value="<?php echo $row_produk_fav['produk_id'];?>"/>
											<input type="hidden" name="slug" value="<?php echo makeslug($row_produk_fav['nama_produk']);?>"/>

						<input type="submit" class="cart_button" name="submit" value="ADD TO CART">
						</p>
						</form>
					</div>
				</div>
				<?php $i++;?>
			<?php endforeach;?>
			<?php endif;?>
    </div>
</div>
</div>